﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Widgetsphere.WebUtils;
using Widgetsphere.Autos.Websitev2.Objects;
using Widgetsphere.Autos.API.FacetedNavigation;

namespace Widgetsphere.Autos.Websitev2
{
    public partial class choose_car_by_make : System.Web.UI.Page
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Populate();
        }

        private void Populate()
        {
            if (MakeDimensionControl1 == null) return;
            MakeDimensionControl1.Populate(RepositoryHelper.MasterResults.AllDimensions.MakeDimension, false);

            var url = new URL(this.Request.Url.AbsoluteUri);
            var zip = url.Parameters.GetValue("zip", "");
            if (string.IsNullOrEmpty(zip))
                lblHeader.Text = "Find cars by Make";
            else
                lblHeader.Text = "Find cars by Make in ZIP code " + zip;
        }

    }
}